﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Text;
using System.Threading.Tasks;

namespace StyleMVVM.DependencyInjection
{
	public delegate object ExportLifeCycleMethod(IInjectionContext injectionContext,
	                                             [ReadOnlyArray] object[] constructorParams);

	/// <summary>
	/// Classes that implement this interface can be used to manage the lifecycle of an export
	/// </summary>
	public interface ILifeCycleContainer
	{
		/// <summary>
		/// Called by the export strategy when it needs to be located. The lifecycle container can decide how it should proceed.
		/// </summary>
		/// <param name="strategy"></param>
		/// <param name="exportMethod"></param>
		/// <param name="container"></param>
		/// <param name="injectionContext"></param>
		/// <param name="constructorParams"></param>
		/// <returns></returns>
		object RetrieveObject(IExportStrategy strategy,
		                      ExportLifeCycleMethod exportMethod,
		                      IDependencyInjectionContainer container,
		                      IInjectionContext injectionContext,
		                      [ReadOnlyArray] object[] constructorParams);

		void Shutdown();
	}
}